﻿
function clock() {
var date = new Date()
var year = date.getYear()
var month = date.getMonth()
var day = date.getDate()
var hour = date.getHours()
var minute = date.getMinutes()
var second = date.getSeconds()
var months = new Array("", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12","13", "14", "15", "16", "17", "18", "19", "20", "21", "22","23","24")
var monthname = months[month]
if (hour > 24) {
hour = hour - 24
}
if (minute < 10) {
minute = "0" + minute
}
if (second < 10) {
second = "0" + second
}
timeshow.innerHTML= "现在是： "+year +"年"+monthname+"月"+day+"日  "+hour+":" +minute+":"+ second
setTimeout("clock()", 1000)
}